package com.zkthink.ceres.promotion.dao;

import com.zkthink.base.mapper.SuperMapper;
import com.zkthink.ceres.promotion.entity.MemberCoupon;

import com.zkthink.ceres.promotion.vo.web.CouponVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * 用户领券表
 * </p>
 *
 * @author JustArgo
 * @date 2020-06-26
 */
@Repository
public interface MemberCouponMapper extends SuperMapper<MemberCoupon> {

	/** 查询优惠券的数量
	 * @author 善泉 2020/6/28 17:47
	 * @return
	 */
	Integer findCouponListCount(Long mid);

	/** 查询优惠券列表
	 * @author 善泉 2020/6/28 17:47
	 * @return
	 */
	List<CouponVO> findCouponList(@Param("mid")Long mid, @Param("start")Integer start, @Param("pageSize")Integer pageSize);

	/** 将优惠券标记为已使用
	 * @author 善泉 2020/6/28 20:42
	 * @return
	 */
	int useCoupon(@Param("mid")Long mid, @Param("couponId")Long couponId);
}
